/*
 * @Description: 浪潮导火车票订单
 * @Version: 2.0
 * @Autor: 许国辉
 * @Date: 2023-05-19 08:24:06
 * @LastEditors: 许国辉
 * @LastEditTime: 2024-12-13 08:02:49
 */
import { BasicColumn } from '/@/components/Table';
import dayjs from 'dayjs';

export const comprehensiveTrainColumns: BasicColumn[] = [
  {
    title: '终端类型',
    dataIndex: 'a0',
    width: 80,
    customRender({ record }) {
      if (record.orderSource === '移动端') return 'app';
    },
  },
  {
    title: '预订时间',
    dataIndex: 'a1',
    width: 180,
    customRender({ record }) {
      return dayjs(record.createTime).format('YYYY/MM/DD HH:mm:ss');
    },
  },
  {
    title: '预订人',
    dataIndex: 'a2',
    width: 80,
    customRender({ record }) {
      return record.bookerName;
    },
  },
  {
    title: '出差申请单号',
    dataIndex: 'a3',
    width: 160,
    customRender({ record }) {
      return record.voucherId;
    },
  },
  {
    title: '订单号',
    dataIndex: 'a4',
    width: 190,
    customRender({ record }) {
      return record.orderId;
    },
  },
  {
    title: '12306订单号',
    dataIndex: 'a5',
    width: 120,
    customRender({ record }) {
      return record.idIn12306;
    },
  },
  {
    title: '职工编号',
    dataIndex: 'a6',
    width: 80,
    customRender({ record }) {
      return record.accountNo;
    },
  },
  {
    title: '旅客姓名',
    dataIndex: 'a7',
    width: 80,
    customRender({ record }) {
      return record.empName;
    },
  },
  {
    title: '联系电话',
    dataIndex: 'a8',
    width: 120,
    customRender({ record }) {
      return record.trainOrder.passengers[0].telephone;
    },
  },
  {
    title: '行程',
    dataIndex: 'a9',
    width: 200,
    customRender({ record }) {
      return record.fromStation + '-' + record.arriveStation;
    },
  },
  {
    title: '出发日期',
    dataIndex: 'a10',
    width: 120,
    customRender({ record }) {
      return dayjs(record.fromDate).format('YYYY/MM/DD');
    },
  },
  {
    title: '出发时间',
    dataIndex: 'a11',
    width: 80,
    customRender({ record }) {
      return record.fromTime;
    },
  },
  {
    title: '到达日期',
    dataIndex: 'a12',
    width: 120,
    customRender({ record }) {
      return dayjs(record.arriveDate).format('YYYY/MM/DD');
    },
  },
  {
    title: '到达时间',
    dataIndex: 'a13',
    width: 80,
    customRender({ record }) {
      return record.arriveTime;
    },
  },
  {
    title: '车次',
    dataIndex: 'a14',
    width: 80,
    customRender({ record }) {
      return record.trainCode;
    },
  },
  {
    title: '席别',
    dataIndex: 'a15',
    width: 80,
    customRender({ record }) {
      return record.seatTypeDes;
    },
  },
  {
    title: '座位号',
    dataIndex: 'a16',
    width: 80,
    customRender({ record }) {
      return record.seatNo;
    },
  },
  {
    title: '票价',
    dataIndex: 'a17',
    width: 80,
    customRender({ record }) {
      return record.ticketMoney;
    },
  },
  {
    title: '改签手续费',
    dataIndex: 'a18',
    width: 100,
    customRender({ record }) {
      return record.trainOrder.passengers[0].changeCharge
        ? record.trainOrder.passengers[0].changeCharge
        : 0;
    },
  },
  {
    title: '退票手续费',
    dataIndex: 'a19',
    width: 100,
    customRender({ record }) {
      return record.refundCharge ? record.refundCharge : 0;
    },
  },
  {
    title: '线上出票服务费',
    dataIndex: 'a20',
    width: 140,
    customRender({ record }) {
      return record.charge;
    },
  },
  {
    title: '线下出票服务费',
    dataIndex: 'a21',
    width: 140,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '凭证打印费',
    dataIndex: 'a22',
    width: 100,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '售票处服务费',
    dataIndex: 'a23',
    width: 120,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '深白云扣款',
    dataIndex: 'a24',
    width: 100,
    customRender({ record }) {
      return record.ticketMoney + record.charge + record.refundCharge + record.changeCharge;
    },
  },
  {
    title: '应付总计',
    dataIndex: 'a25',
    width: 80,
    customRender({ record }) {
      return record.ticketMoney + record.charge + record.refundCharge + record.changeCharge;
    },
  },
  {
    title: '总金额包含服务费和凭证打印费',
    dataIndex: 'a26',
    width: 160,
    customRender({ record }) {
      return record.ticketMoney + record.charge + record.refundCharge + record.changeCharge;
    },
  },
  {
    title: '订单类别',
    dataIndex: 'a27',
    width: 80,
    customRender({ record }) {
      return record.travelType;
    },
  },
  {
    title: '证件号',
    dataIndex: 'a28',
    width: 180,
    customRender({ record }) {
      return record.trainOrder.passengers[0].certNo;
    },
  },
  {
    title: '客票状态',
    dataIndex: 'a29',
    width: 80,
    customRender({ record }) {
      return record.travelType;
    },
  },
  {
    title: '结算状态',
    dataIndex: 'a30',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '成本中心',
    dataIndex: 'a31',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '联系人',
    dataIndex: 'a32',
    width: 80,
    customRender({ record }) {
      return record.trainOrder.linkMans[0].linkManName;
    },
  },
  {
    title: 'DBI信息',
    dataIndex: 'a33',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: 'OA申请单号',
    dataIndex: 'a34',
    width: 160,
    customRender({ record }) {
      return record.voucherId;
    },
  },
  {
    title: '业务经理',
    dataIndex: 'a35',
    width: 80,
    customRender({ record }) {
      return record.busiManage ? record.busiManage : '-';
    },
  },
  {
    title: '原订单号',
    dataIndex: 'a36',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '是否vip',
    dataIndex: 'a37',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '提前预订天数',
    dataIndex: 'a38',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '渠道服务费',
    dataIndex: 'a39',
    width: 100,
    customRender({}) {
      return '0';
    },
  },
  {
    title: '预订人部门',
    dataIndex: 'a40',
    width: 100,
    customRender({ record }) {
      if (record.departmentId != null) {
        return record.departmentId;
      }
    },
  },
  {
    title: '操作员',
    dataIndex: 'a41',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '支付方式',
    dataIndex: 'a42',
    width: 80,
    customRender() {
      return '月付';
    },
  },
  {
    title: '个人支付金额',
    dataIndex: 'a43',
    width: 120,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '个人退款金额',
    dataIndex: 'a44',
    width: 120,
    customRender({ record }) {
      return record.refundAmount ? record.refundAmount : 0;
    },
  },
  {
    title: '公司支付金额',
    dataIndex: 'a45',
    width: 120,
    // customRender({ record }) {
    //   return record.ticketMoney + record.charge;
    // },
    customRender({ record }) {
      return record.ticketMoney + record.charge + record.refundCharge + record.changeCharge;
    },
  },
  {
    title: '公司退款金额',
    dataIndex: 'a46',
    width: 120,
    customRender({ record }) {
      return record.refundMoney;
    },
  },
  {
    title: '交易流水号',
    dataIndex: 'a47',
    width: 100,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '费用承担部门',
    dataIndex: 'a48',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '项目编号',
    dataIndex: 'a49',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '项目名称',
    dataIndex: 'a50',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '差旅事项',
    dataIndex: 'a51',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '超标原因',
    dataIndex: 'a52',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '超标金额',
    dataIndex: 'a53',
    width: 80,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '超标描述',
    dataIndex: 'a54',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '费用类型',
    dataIndex: 'a55',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '差旅授权号',
    dataIndex: 'a56',
    width: 110,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批状态',
    dataIndex: 'a57',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '给审批人留言',
    dataIndex: 'a58',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组1类型',
    dataIndex: 'a59',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组1审批人',
    dataIndex: 'a60',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组2类型',
    dataIndex: 'a61',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组2审批人',
    dataIndex: 'a62',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组3类型',
    dataIndex: 'a63',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组3审批人',
    dataIndex: 'a64',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组4类型',
    dataIndex: 'a65',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组4审批人',
    dataIndex: 'a66',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '员工部门',
    dataIndex: 'a67',
    width: 80,
    customRender({ record }) {
      if (record.departmentId != null) {
        return record.departmentId;
      }
    },
  },
  {
    title: '原票价',
    dataIndex: 'a68',
    width: 80,
    customRender() {
      return '-';
      // if (record.travelType === '出票单' || record.travelType === '退票单') {
      //   return 0;
      // } else {
      //   return -(
      //     record.trainOrder.passengers[0].ticketMoney +
      //     record.trainOrder.passengers[0].changeCharge +
      //     record.trainOrder.passengers[0].charge +
      //     record.trainOrder.passengers[0].refundMoney
      //   );
      // }
    },
  },
  {
    title: '退改状态',
    dataIndex: 'a69',
    width: 80,
    customRender({ record }) {
      return record.trainOrder.passengers[0].quitStatus
        ? record.trainOrder.passengers[0].quitStatus
        : '-';
    },
  },
  {
    title: '改签类型',
    dataIndex: 'a70',
    width: 80,
    customRender({ record }) {
      return record.trainOrder.passengers[0].changeType
        ? record.trainOrder.passengers[0].changeType
        : '-';
    },
  },
  {
    title: '退票时间',
    dataIndex: 'a71',
    width: 100,
    customRender({ record }) {
      return record.refundDate ? record.refundDate : '-';
    },
  },
  {
    title: '退票下单人',
    dataIndex: 'a72',
    width: 100,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '消费记录id',
    dataIndex: 'recordId',
    customRender({ record }) {
      return 'train' + record.id;
    },
    width: 100,
  },
  // {
  //   title: '订单号',
  //   dataIndex: 'a74',
  //   width: 190,
  //   customRender({ record }) {
  //     return record.orderId;
  //   },
  // },
  {
    title: '乘车人卡号',
    dataIndex: 'a75',
    width: 180,
    customRender({ record }) {
      return record.trainOrder.passengers[0].certNo;
    },
  },
  {
    title: '出发城市',
    dataIndex: 'a76',
    width: 80,
    customRender({ record }) {
      return record.fromStation;
    },
  },
  {
    title: '到达城市',
    dataIndex: 'a77',
    width: 80,
    customRender({ record }) {
      return record.arriveStation;
    },
  },
];
